<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>down log</title>
<link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
	<div class="row">
		<input class="form-control" @keyup.enter="search" placeholder="search">
	</div>
	<a v-for="log in logs" class="btn" href="logs/{{log}}">{{log}}</a>
<div>
</body>
<script src="https://cdn.bootcss.com/vue/1.0.18/vue.min.js"></script>
<script src="https://cdn.bootcss.com/vue-resource/0.7.0/vue-resource.js"></script>
<script type="text/javascript">
	new Vue({
		el : '.container-fluid',
		data: {
			logs: ['all.logs','all.logs.2019-10-09'],
		},
		methods: {
			search: function(e){
				var str = e.target.value;
				this.doSearch(str);
			},
			doSearch: function(search){
				this.$http({method:'GET', url:'/log?type=list&search='+search}).then(function(response){
					this.logs = response.data;
				})
			}
		},
		ready: function(){
			this.doSearch('');
		}
	})
</script>
</html>